Skip to content

Updated Packages & Functionality - #111

Merged
mitchelsellers merged 2 commits into
developfrom
feature/finalized-net-9
Nov 27, 2025
Merged

Updated Packages & Functionality#111
mitchelsellers merged 2 commits into
developfrom
feature/finalized-net-9

Conversation

@mitchelsellers

@mitchelsellers mitchelsellers commented Nov 27, 2025

Copy link
Copy Markdown
Contributor

Updated to latest SDK's and builds

Summary by CodeRabbit

  • Chores

    • Upgraded CI and release workflows with newer tooling versions and environment handling
    • Updated project and test dependencies to recent stable releases
    • Added automated release workflow for changelog generation with categorized labels
  • Refactor

    • Improved resource management and streamlined parsing logic for maintainability
    • Removed legacy serialization support from exception handling
  • Bug Fix

    • Fixed a broken package reference in a sample project

✏️ Tip: You can customize this high-level summary in your review settings.

Updated to latest SDK's and builds
@mitchelsellers mitchelsellers added the dependencies Pull requests that update a dependency file label Nov 27, 2025
@coderabbitai

coderabbitai Bot commented Nov 27, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Updates CI/CD workflows and GitVersion configuration, bumps multiple NuGet dependencies, introduces a release changelog workflow, refactors spreadsheet generator and parser for resource and control-flow changes, and removes the serialization constructor from SpreadsheetParserException.

Changes

Cohort / File(s) Summary
CI/CD workflow configuration
\.github/release.yml, \.github/workflows/ci-build.yml, \.github/workflows/release-build.yml
Adds a release workflow with changelog categories and exclusions; upgrades GitVersion actions to v4.2.0 and versionSpec to 6.4.0; changes sonar token usage to environment variable.
GitVersion configuration
GitVersion.yml
Removes label-number-pattern: '[/-](?<number>\d+)[-/]' from the pull-request branch config.
NuGet package updates
samples/NetCore.Utilities.SpreadsheetExample/NetCore.Utilities.SpreadsheetExample.csproj, src/NetCore.Utilities.Spreadsheet/*.csproj, src/NetCore.Utilities.Spreadsheet.Tests/*.csproj
Fixes package name and bumps DocumentFormat.OpenXml to 3.3.0 and Microsoft.SourceLink.GitHub to 8.0.0; updates test dependencies (Bogus, coverlet.collector, FluentAssertions, Microsoft.NET.Test.Sdk, xunit, xunit.runner.visualstudio).
Spreadsheet generator refactoring
src/NetCore.Utilities.Spreadsheet/OpenXmlSpreadsheetGenerator.cs
Uses using var for SpreadsheetDocument, removes explicit Close() calls, and uses non-null assertion when accessing WorkbookPart.Workbook.
Spreadsheet parser refactoring
src/NetCore.Utilities.Spreadsheet/OpenXmlSpreadsheetParser.cs
Reworks GetCellValue: handles SharedString via an if-path that resolves the parent worksheet and SharedStringTablePart, handles Boolean via a separate if-path, otherwise returns raw value.
Exception and attribute updates
src/NetCore.Utilities.Spreadsheet/SpreadsheetParserException.cs, src/NetCore.Utilities.Spreadsheet/SpreadsheetColumnAttribute.cs
Removes protected serialization constructor and System.Runtime.Serialization using; adds XML doc tag for formula parameter on SpreadsheetColumnAttribute constructor.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Parser as OpenXmlSpreadsheetParser
    participant Worksheet
    participant SST as SharedStringTablePart

    Caller->>Parser: GetCellValue(cell)
    alt DataType == SharedString
        Parser->>Worksheet: Resolve parent worksheet
        Worksheet-->>Parser: worksheet ref
        Parser->>SST: Get string by index
        SST-->>Parser: string value
        Parser-->>Caller: return string
    else DataType == Boolean
        Parser-->>Caller: return "FALSE" if "0" else "TRUE"
    else Other
        Parser-->>Caller: return raw value
    end
Loading
sequenceDiagram
    participant Code
    participant Doc as SpreadsheetDocument(IDisposable)
    participant Resources

    Code->>Doc: using var doc = Create(...)
    activate Doc
    Code->>Doc: perform operations (write sheets/cells)
    Code-->>Doc: scope exit
    deactivate Doc
    Doc->>Resources: Dispose() — close & free resources
    Note over Resources: Disposal now implicit via using var
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review highlights:
    • Verify GitVersion v4.x usage and removed useConfigFile semantics across workflows.
    • Confirm Sonar scanner env.SONAR_TOKEN substitution behaves as intended in CI.
    • Validate DocumentFormat.OpenXml 3.3.0 compatibility with generator/parser changes.
    • Ensure GetCellValue refactor preserves behavior for shared strings and booleans.
    • Check removal of serialization constructor does not break any serialization scenarios.

Possibly related PRs

Poem

🐰 A rabbit hops through code so bright,

Bumps the versions, trims the byte,
Using var to tidy up the nest,
Strings and booleans now behave their best,
Serialization shelved for later play — hooray! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Updated Packages & Functionality' is partially related to the changeset but overly broad and generic. While packages are indeed updated across multiple files, the title doesn't clearly communicate the main changes such as GitVersion upgrades, workflow configuration updates, or SDK modernization. Consider a more specific title like 'Upgrade dependencies and GitVersion to latest versions' or 'Update to .NET 9 SDKs with GitVersion v4.2.0' to better reflect the primary changes and context from the feature branch.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfa2a33 and 5acb9a0.

📒 Files selected for processing (1)
  • samples/NetCore.Utilities.SpreadsheetExample/NetCore.Utilities.SpreadsheetExample.csproj (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/NetCore.Utilities.Spreadsheet/NetCore.Utilities.Spreadsheet.csproj (1)

28-30: Critical: Malformed MSBuild condition syntax.

Line 28 has a syntax error: '$GITHUB_ACTIONS)' is missing the opening $ and parenthesis. This will prevent the project from building.

Apply this diff:

-	<PropertyGroup Condition="'$GITHUB_ACTIONS)' == 'true'">
+	<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
🧹 Nitpick comments (3)
src/NetCore.Utilities.Spreadsheet/SpreadsheetColumnAttribute.cs (1)

14-23: Constructor XML doc now correctly documents formula parameter

The added <param name="formula"> XML comment is accurate and brings the constructor docs in line with the existing Formula property. If you want to go a step further, you could mirror the “SUM, MIN, MAX, etc.” examples from the property doc here for extra clarity, but that’s purely optional.

src/NetCore.Utilities.Spreadsheet/OpenXmlSpreadsheetGenerator.cs (1)

49-90: Using using var for SpreadsheetDocument is correct; consider avoiding the null-forgiving operator.

The switch to using var spreadsheetDocument = SpreadsheetDocument.Create(...) in both single- and multi-sheet writers gives proper deterministic disposal, making explicit Close() calls unnecessary and keeping the lifetime scoped to the method body. That looks good.

In the multi-sheet path (Line 162), you can avoid WorkbookPart! and rely on the already-initialized workbookPart variable:

-        var sheets = spreadsheetDocument.WorkbookPart!.Workbook.AppendChild(new Sheets());
+        var sheets = workbookPart.Workbook.AppendChild(new Sheets());

This keeps nullability clearer without changing behavior, since workbookPart is assigned just above.

Also applies to: 159-205

src/NetCore.Utilities.Spreadsheet/OpenXmlSpreadsheetParser.cs (1)

158-179: Shared-string resolution works but is heavier than needed; consider reusing known context.

The new logic correctly:

  • Walks up the parent chain to find the owning Worksheet.
  • Uses Worksheet.WorksheetPart.OpenXmlPackage and GetPartsOfType<SharedStringTablePart>() to resolve the shared string table.
  • Maps the numeric index in cell.InnerText to the actual string.

Two possible improvements:

  • You already have SpreadsheetDocument excelDoc and WorksheetPart wsPart in ParseDocumentInternal. Passing a SharedStringTablePart (or a lookup delegate) into GetCellValue would avoid walking the DOM and resolving the package for every shared-string cell, which could be a noticeable win on large worksheets.

  • When sstPart is null, you currently fall back to returning value (the numeric index). If this scenario is considered exceptional rather than valid, you might prefer throwing a SpreadsheetParserException so callers don’t silently receive the index instead of the string.

Neither change is strictly required, but both would make behavior and performance more predictable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3645e1a and dfa2a33.

📒 Files selected for processing (11)
  • .github/release.yml (1 hunks)
  • .github/workflows/ci-build.yml (2 hunks)
  • .github/workflows/release-build.yml (1 hunks)
  • GitVersion.yml (0 hunks)
  • samples/NetCore.Utilities.SpreadsheetExample/NetCore.Utilities.SpreadsheetExample.csproj (1 hunks)
  • src/NetCore.Utilities.Spreadsheet.Tests/NetCore.Utilities.Spreadsheet.Tests.csproj (1 hunks)
  • src/NetCore.Utilities.Spreadsheet/NetCore.Utilities.Spreadsheet.csproj (1 hunks)
  • src/NetCore.Utilities.Spreadsheet/OpenXmlSpreadsheetGenerator.cs (3 hunks)
  • src/NetCore.Utilities.Spreadsheet/OpenXmlSpreadsheetParser.cs (1 hunks)
  • src/NetCore.Utilities.Spreadsheet/SpreadsheetColumnAttribute.cs (1 hunks)
  • src/NetCore.Utilities.Spreadsheet/SpreadsheetParserException.cs (0 hunks)
💤 Files with no reviewable changes (2)
  • GitVersion.yml
  • src/NetCore.Utilities.Spreadsheet/SpreadsheetParserException.cs
🧰 Additional context used
🧬 Code graph analysis (1)
src/NetCore.Utilities.Spreadsheet/OpenXmlSpreadsheetParser.cs (1)
src/NetCore.Utilities.Spreadsheet/SpreadsheetParserException.cs (2)
  • SpreadsheetParserException (12-15)
  • SpreadsheetParserException (17-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze Code Quality
🔇 Additional comments (8)
src/NetCore.Utilities.Spreadsheet/NetCore.Utilities.Spreadsheet.csproj (1)

37-42: Based on my verification, I can now provide the rewritten review comment:


DocumentFormat.OpenXml 3.3.0 is compatible with the spreadsheet parsing and generation code.

The codebase uses high-level OpenXml APIs (SpreadsheetDocument, Descendants(), Elements(), Append(), GetPartsOfType(), etc.) that remain stable in 3.x. The breaking changes between 2.16.0 and 3.x (such as OpenXmlPackage.Package type change to IPackage, OpenXmlElementList becoming a struct, and TypedOpenXmlPartReader removal) do not apply to this implementation. The code was designed for 3.3.0 and compiles successfully with the target framework net9.0.

src/NetCore.Utilities.Spreadsheet.Tests/NetCore.Utilities.Spreadsheet.Tests.csproj (1)

10-21: Let me verify the target framework and check for any potential compatibility issues:
<function_calls>

#!/bin/bash

Check the test project's target framework

echo "=== Test Project File (lines 1-30) ==="
head -30 src/NetCore.Utilities.Spreadsheet.Tests/NetCore.Utilities.Spreadsheet.Tests.csproj

echo -e "\n=== Main Project Target Framework ==="
head -30 src/NetCore.Utilities.Spreadsheet/NetCore.Utilities.Spreadsheet.csproj | grep -i target

Check for using statements in test files

echo -e "\n=== Using Statements in Test Files ==="
rg -n '^using ' src/NetCore.Utilities.Spreadsheet.Tests --type cs -m 10



</blockquote></details>
<details>
<summary>.github/workflows/ci-build.yml (3)</summary><blockquote>

`81-88`: **Consistent GitVersion upgrade across jobs.**

The GitVersion v4.2.0 upgrade is consistently applied. Ensure the verification from the build job above covers both jobs.

---

`91-100`: **Security improvement: Sonar token passed via environment variable.**

The change to use `env.SONAR_TOKEN` instead of inline secrets reference is a security best practice. Secrets passed via environment variables are less likely to leak in logs or debug output.

---

`26-33`: **No compatibility issues found. The upgrade to GitVersion action v4.2.0 is safe and compatible with the project.**

The GitVersion.yml configuration exists at the repository root with standard settings that v4.2.0 will auto-detect. The `useConfigFile` parameter removal in v4 indicates the action now auto-discovers the configuration file, which is the case here. The versionSpec 6.4.0 (minor bump from 6.0.5) is compatible, and the `majorMinorPatch` output variable referenced in the workflow (line 38) is available in v4.2.0. No configuration changes are required.

</blockquote></details>
<details>
<summary>.github/workflows/release-build.yml (1)</summary><blockquote>

`25-32`: **GitVersion v4.2.0 upgrade aligned with CI workflow.**

Release workflow applies the same GitVersion v4.2.0 and versionSpec 6.4.0 updates as the CI build workflow, ensuring consistency across pipelines. The verification needed for ci-build.yml applies here as well.

</blockquote></details>
<details>
<summary>.github/release.yml (1)</summary><blockquote>

`1-23`: **Changelog configuration looks well-structured.**

The release configuration provides clear categorization of PRs into changelog sections and excludes non-relevant issue types (question, wontfix, invalid). The catch-all "Other Changes" category ensures comprehensive coverage. This is a solid foundation for automated release notes.

</blockquote></details>
<details>
<summary>src/NetCore.Utilities.Spreadsheet/OpenXmlSpreadsheetParser.cs (1)</summary><blockquote>

`181-191`: **Clarify boolean cell semantics and ensure tests cover them.**

The boolean branch now returns `"FALSE"` only for `"0"` and `"TRUE"` for any other value:

```csharp
return value switch
{
    "0" => "FALSE",
    _ => "TRUE"
};

This is simple, but it means any unexpected value (e.g., "2" or "foo") will also be treated as "TRUE". If that’s intentional, it would be good to have tests documenting it; if not, you may want a stricter mapping ("0"/"1" only, or explicit error for invalid values).

….SpreadsheetExample.csproj

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@mitchelsellers
mitchelsellers merged commit 8d616af into develop Nov 27, 2025
2 of 3 checks passed
@mitchelsellers
mitchelsellers deleted the feature/finalized-net-9 branch November 27, 2025 05:01
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant